package com.yl.service;

import com.yl.dto.InventoryDTO;
import com.yl.entity.Inventory;
import com.yl.query.InventoryQuery;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;

import java.util.List;


/**
 * @author yangl
 */
@Service
public class InventoryClientService {
    @DubboReference
    private InventoryService inventoryService;


    public void saveInventory(InventoryDTO inventoryDTO){
        Inventory inventory = new Inventory();
        BeanUtils.copyProperties(inventoryDTO, inventory);
        inventoryService.save(inventory);
    }

    public List<Inventory> inventoryList(String status){
        return inventoryService.inventoryList(status);
    }

    public List<Inventory> inventoryPage(InventoryQuery query){
        return inventoryService.inventoryPage(query);
    }
}
